package io.scnb.lesson001.demo18;

import org.junit.Test;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

@Ann12(name = "scnb")
@Ann12(name = "我爱java")
public class UseAnnotation12 {

    @Ann12s({
            @Ann12(name = "scnb1"),
            @Ann12(name = "scnb2")
    })
    private String s1;

    @Test
    public void test01() throws NoSuchFieldException {
        Annotation[] annotations = UseAnnotation12.class.getAnnotations();
        for (Annotation annotation : annotations) {
            System.out.println(annotation);
        }
        System.out.println("-------------");
        Field field = UseAnnotation12.class.getDeclaredField("s1");
        for (Annotation annotation : field.getAnnotations()) {
            System.out.println(annotation);
        }
    }
}
